<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Gestion_Des_Inscriptions_Universitaires:  Fichier source de /home/omid/Bureau/projet/gestion-des-inscriptions-universitaires-version-finale/src/Date.c</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Généré par Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Gestion_Des_Inscriptions_Universitaires</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Page&#160;principale</span></a></li>
      <li><a href="pages.html"><span>Pages&#160;associées</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
      <li><a href="dirs.html"><span>Répertoires</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Liste&#160;des&#160;fichiers</span></a></li>
      <li><a href="globals.html"><span>Membres&#160;de&#160;fichier</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_date_8c.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Date.c</div>  </div>
</div>
<div class="contents">
<a href="_date_8c.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &quot;<a class="code" href="_date_8h.html" title="Fichier d&#39;entête du module date.">Date.h</a>&quot;</span>
<a name="l00002"></a>00002 
<a name="l00003"></a><a class="code" href="_date_8c.html#acf90c01a7944bfe5a2563b69c830c0c9">00003</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="_date_8c.html#acf90c01a7944bfe5a2563b69c830c0c9">jour</a>[]={<span class="stringliteral">&quot;lundi&quot;</span>,<span class="stringliteral">&quot;mardi&quot;</span>,<span class="stringliteral">&quot;mercredi&quot;</span>,<span class="stringliteral">&quot;jeudi&quot;</span>,<span class="stringliteral">&quot;vendredi&quot;</span>,<span class="stringliteral">&quot;samedi&quot;</span>,<span class="stringliteral">&quot;dimanche&quot;</span>};
<a name="l00004"></a><a class="code" href="_date_8c.html#a273956a68e89f91530aa8a4b33a94bb5">00004</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="_date_8c.html#a273956a68e89f91530aa8a4b33a94bb5">mois</a>[]={<span class="stringliteral">&quot;janvier&quot;</span>,<span class="stringliteral">&quot;fevrier&quot;</span>,<span class="stringliteral">&quot;mars&quot;</span>,<span class="stringliteral">&quot;avril&quot;</span>,<span class="stringliteral">&quot;mai&quot;</span>,<span class="stringliteral">&quot;juin&quot;</span>,<span class="stringliteral">&quot;juillet&quot;</span>,<span class="stringliteral">&quot;aout&quot;</span>,<span class="stringliteral">&quot;septembre&quot;</span>,<span class="stringliteral">&quot;octobre&quot;</span>,<span class="stringliteral">&quot;novembre&quot;</span>,<span class="stringliteral">&quot;decembre&quot;</span>};
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="comment">/* *********************************************************************</span>
<a name="l00009"></a>00009 <span class="comment">                 Fonction de la structure Date</span>
<a name="l00010"></a>00010 <span class="comment">********************************************************************* */</span>
<a name="l00011"></a>00011 
<a name="l00012"></a><a class="code" href="_date_8h.html#a4dadee0aa90a074dbf5fcbc960bb0e35">00012</a> <span class="keywordtype">void</span> <a class="code" href="_date_8c.html#a4dadee0aa90a074dbf5fcbc960bb0e35">initDat</a>(<a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="_date_8c.html#acf90c01a7944bfe5a2563b69c830c0c9">jour</a>, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="_date_8c.html#a273956a68e89f91530aa8a4b33a94bb5">mois</a>,
<a name="l00013"></a>00013              <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> annee,<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> heure,<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> minute)
<a name="l00014"></a>00014 {
<a name="l00015"></a>00015   <span class="keywordflow">if</span>(date)
<a name="l00016"></a>00016     {
<a name="l00017"></a>00017         <a class="code" href="_date_8c.html#af791aea93535e7af19da427557d8d987">setJourDat</a>(date,jour);
<a name="l00018"></a>00018         <a class="code" href="_date_8c.html#aa32baa78277c74c139a8df4e1babdd01">setMoisDat</a>(date,mois);
<a name="l00019"></a>00019         <a class="code" href="_date_8c.html#a61ddd64fd30de78a30c3dc2f851678c3">setAnneeDat</a>(date,annee);
<a name="l00020"></a>00020         <a class="code" href="_date_8c.html#a91a11973f94a56d743b243945f315f1c">setHeureDat</a>(date,heure);
<a name="l00021"></a>00021         <a class="code" href="_date_8c.html#a24effb683b6650ef36affd4d67bb521c">setMinuteDat</a>(date,minute);
<a name="l00022"></a>00022     }
<a name="l00023"></a>00023 }
<a name="l00024"></a>00024 
<a name="l00025"></a><a class="code" href="_date_8h.html#a0f7b7c002ab6b673517a4ea3ce9a1f41">00025</a> <span class="keywordtype">void</span> <a class="code" href="_date_8c.html#a0f7b7c002ab6b673517a4ea3ce9a1f41">libDat</a>(<a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date)
<a name="l00026"></a>00026 {
<a name="l00027"></a>00027   <span class="keywordflow">if</span>(date)
<a name="l00028"></a>00028     {
<a name="l00029"></a>00029         date-&gt;<a class="code" href="structs_date.html#a11599dcc9feadeca21b14a78da8c4172">jour</a>  = 0;
<a name="l00030"></a>00030         date-&gt;<a class="code" href="structs_date.html#a4b14e2d3e1996788533cf7401e6e98e9">mois</a>  = 0;
<a name="l00031"></a>00031         date-&gt;<a class="code" href="structs_date.html#add9049e10a4e76da935ad87e79f356c5">annee</a> = 0;
<a name="l00032"></a>00032         date-&gt;<a class="code" href="structs_date.html#a4a1abfda81e08c6312236b17f00a254b">heure</a> = 0;
<a name="l00033"></a>00033         date-&gt;<a class="code" href="structs_date.html#a8ccf54199aa6a18ea879384260cad09d">minute</a>= 0;
<a name="l00034"></a>00034     }
<a name="l00035"></a>00035 }
<a name="l00036"></a>00036 
<a name="l00037"></a><a class="code" href="_date_8h.html#a91969b639b15aab01753c1fdf3158c0a">00037</a> <a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> * <a class="code" href="_date_8c.html#a91969b639b15aab01753c1fdf3158c0a">creDat</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="_date_8c.html#acf90c01a7944bfe5a2563b69c830c0c9">jour</a>, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="_date_8c.html#a273956a68e89f91530aa8a4b33a94bb5">mois</a>,
<a name="l00038"></a>00038               <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> annee,<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> heure,<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> minute)
<a name="l00039"></a>00039 {
<a name="l00040"></a>00040   <a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> * date = (<a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *) calloc (1 , <span class="keyword">sizeof</span>(<a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a>));
<a name="l00041"></a>00041   <span class="keywordflow">if</span>(date == NULL)
<a name="l00042"></a>00042     {
<a name="l00043"></a>00043       fprintf(stderr, <span class="stringliteral">&quot;Mémoire insuffisante&quot;</span>);
<a name="l00044"></a>00044       exit(EXIT_FAILURE);
<a name="l00045"></a>00045     }
<a name="l00046"></a>00046   <a class="code" href="_date_8c.html#a4dadee0aa90a074dbf5fcbc960bb0e35">initDat</a>(date, jour, mois, annee, heure, minute);
<a name="l00047"></a>00047   <span class="keywordflow">return</span> date;
<a name="l00048"></a>00048 }
<a name="l00049"></a>00049 
<a name="l00050"></a><a class="code" href="_date_8h.html#af9b759e4f66d43f5e95b54ab3c060a78">00050</a> <span class="keywordtype">void</span> <a class="code" href="_date_8c.html#af9b759e4f66d43f5e95b54ab3c060a78">detDat</a>(<a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> **date)
<a name="l00051"></a>00051 {
<a name="l00052"></a>00052   <span class="keywordflow">if</span>(date)
<a name="l00053"></a>00053     {
<a name="l00054"></a>00054       <a class="code" href="_date_8c.html#a0f7b7c002ab6b673517a4ea3ce9a1f41">libDat</a>((*date));
<a name="l00055"></a>00055       free((*date));
<a name="l00056"></a>00056       (*date) = NULL;
<a name="l00057"></a>00057     }
<a name="l00058"></a>00058 }
<a name="l00059"></a>00059 <span class="comment">/*</span>
<a name="l00060"></a>00060 <span class="comment">void copier_Dat(Date ** dateDest, const Date * dateSrc)</span>
<a name="l00061"></a>00061 <span class="comment">{</span>
<a name="l00062"></a>00062 <span class="comment">  if((*dateDest) == NULL)</span>
<a name="l00063"></a>00063 <span class="comment">    {</span>
<a name="l00064"></a>00064 <span class="comment">      (*dateDest) = creDat();</span>
<a name="l00065"></a>00065 <span class="comment">    }</span>
<a name="l00066"></a>00066 <span class="comment">  if(dateSrc)</span>
<a name="l00067"></a>00067 <span class="comment">    {</span>
<a name="l00068"></a>00068 <span class="comment">      setJourDat((*dateDest), getJourDat(dateSrc));</span>
<a name="l00069"></a>00069 <span class="comment">      setMoisDat((*dateDest), getMoisDat(dateSrc));</span>
<a name="l00070"></a>00070 <span class="comment">      setAnneeDat((*dateDest), getAnneeDat(dateSrc));</span>
<a name="l00071"></a>00071 <span class="comment">      setHeureDat((*dateDest), getHeureDat(dateSrc));</span>
<a name="l00072"></a>00072 <span class="comment">      setMinuteDat((*dateDest), getMinuteDat(dateSrc));</span>
<a name="l00073"></a>00073 <span class="comment">    }</span>
<a name="l00074"></a>00074 <span class="comment">  else</span>
<a name="l00075"></a>00075 <span class="comment">    {</span>
<a name="l00076"></a>00076 <span class="comment">      detDat(dateDest);</span>
<a name="l00077"></a>00077 <span class="comment">      (*dateDest) = NULL;</span>
<a name="l00078"></a>00078 <span class="comment">    }</span>
<a name="l00079"></a>00079 <span class="comment">}</span>
<a name="l00080"></a>00080 <span class="comment">*/</span>
<a name="l00081"></a>00081 <span class="comment">/* *********************************************************************</span>
<a name="l00082"></a>00082 <span class="comment">           Accesseurs et Mutateurs de la structure Date</span>
<a name="l00083"></a>00083 <span class="comment">********************************************************************* */</span>
<a name="l00084"></a>00084 
<a name="l00085"></a><a class="code" href="_date_8h.html#aff629a7f3279f4af67f19cd86f856402">00085</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="_date_8c.html#aff629a7f3279f4af67f19cd86f856402">getJourDat</a>(<span class="keyword">const</span> <a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date)
<a name="l00086"></a>00086 {
<a name="l00087"></a>00087   <span class="keywordflow">if</span>(date)
<a name="l00088"></a>00088     <span class="keywordflow">return</span> date-&gt;<a class="code" href="structs_date.html#a11599dcc9feadeca21b14a78da8c4172">jour</a>;
<a name="l00089"></a>00089   <span class="keywordflow">return</span> 0;
<a name="l00090"></a>00090 }
<a name="l00091"></a>00091 
<a name="l00092"></a><a class="code" href="_date_8h.html#af791aea93535e7af19da427557d8d987">00092</a> <span class="keywordtype">void</span> <a class="code" href="_date_8c.html#af791aea93535e7af19da427557d8d987">setJourDat</a>(<a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="_date_8c.html#acf90c01a7944bfe5a2563b69c830c0c9">jour</a>)
<a name="l00093"></a>00093 {
<a name="l00094"></a>00094   <span class="keywordflow">if</span>(date)
<a name="l00095"></a>00095     {
<a name="l00096"></a>00096       <span class="keywordflow">if</span>(jour == 0)
<a name="l00097"></a>00097             <span class="keywordflow">return</span>;
<a name="l00098"></a>00098       <span class="keywordflow">if</span>(date-&gt;<a class="code" href="structs_date.html#a4b14e2d3e1996788533cf7401e6e98e9">mois</a> == 1 || date-&gt;<a class="code" href="structs_date.html#a4b14e2d3e1996788533cf7401e6e98e9">mois</a> == 3
<a name="l00099"></a>00099           || date-&gt;<a class="code" href="structs_date.html#a4b14e2d3e1996788533cf7401e6e98e9">mois</a> == 5 || date-&gt;<a class="code" href="structs_date.html#a4b14e2d3e1996788533cf7401e6e98e9">mois</a> == 7
<a name="l00100"></a>00100           || date-&gt;<a class="code" href="structs_date.html#a4b14e2d3e1996788533cf7401e6e98e9">mois</a> == 8 || date-&gt;<a class="code" href="structs_date.html#a4b14e2d3e1996788533cf7401e6e98e9">mois</a> == 10
<a name="l00101"></a>00101           || date-&gt;<a class="code" href="structs_date.html#a4b14e2d3e1996788533cf7401e6e98e9">mois</a> == 12)
<a name="l00102"></a>00102           {
<a name="l00103"></a>00103             <span class="keywordflow">if</span>(jour &gt; 31)
<a name="l00104"></a>00104               <span class="keywordflow">return</span>;
<a name="l00105"></a>00105           }
<a name="l00106"></a>00106           <span class="keywordflow">else</span>
<a name="l00107"></a>00107           {
<a name="l00108"></a>00108         <span class="keywordflow">if</span>(jour &gt; 30)
<a name="l00109"></a>00109               <span class="keywordflow">return</span>;
<a name="l00110"></a>00110       }
<a name="l00111"></a>00111       <span class="keywordflow">if</span>(date-&gt;<a class="code" href="structs_date.html#a4b14e2d3e1996788533cf7401e6e98e9">mois</a> == 2 &amp;&amp; jour &gt; 29)
<a name="l00112"></a>00112             <span class="keywordflow">return</span>;
<a name="l00113"></a>00113       date-&gt;<a class="code" href="structs_date.html#a11599dcc9feadeca21b14a78da8c4172">jour</a> = <a class="code" href="_date_8c.html#acf90c01a7944bfe5a2563b69c830c0c9">jour</a>;
<a name="l00114"></a>00114     }
<a name="l00115"></a>00115 }
<a name="l00116"></a>00116 
<a name="l00117"></a><a class="code" href="_date_8h.html#a8e5de805dadea97233846ff131b40886">00117</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="_date_8c.html#a8e5de805dadea97233846ff131b40886">getMoisDat</a>(<span class="keyword">const</span> <a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date)
<a name="l00118"></a>00118 {
<a name="l00119"></a>00119   <span class="keywordflow">if</span>(date)
<a name="l00120"></a>00120     <span class="keywordflow">return</span> date-&gt;<a class="code" href="structs_date.html#a4b14e2d3e1996788533cf7401e6e98e9">mois</a>;
<a name="l00121"></a>00121   <span class="keywordflow">return</span> 0;
<a name="l00122"></a>00122 }
<a name="l00123"></a>00123 
<a name="l00124"></a>00124 
<a name="l00125"></a><a class="code" href="_date_8h.html#aa32baa78277c74c139a8df4e1babdd01">00125</a> <span class="keywordtype">void</span> <a class="code" href="_date_8c.html#aa32baa78277c74c139a8df4e1babdd01">setMoisDat</a>(<a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="_date_8c.html#a273956a68e89f91530aa8a4b33a94bb5">mois</a>)
<a name="l00126"></a>00126 {
<a name="l00127"></a>00127   <span class="keywordflow">if</span>(date)
<a name="l00128"></a>00128     {
<a name="l00129"></a>00129       <span class="keywordflow">if</span>(mois &gt; 0 &amp;&amp; mois &lt; 13)
<a name="l00130"></a>00130         date-&gt;<a class="code" href="structs_date.html#a4b14e2d3e1996788533cf7401e6e98e9">mois</a> = <a class="code" href="_date_8c.html#a273956a68e89f91530aa8a4b33a94bb5">mois</a>;
<a name="l00131"></a>00131     }
<a name="l00132"></a>00132 }
<a name="l00133"></a>00133 
<a name="l00134"></a><a class="code" href="_date_8h.html#aad0245d0db096124a5fe59227ed3adcc">00134</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="_date_8c.html#aad0245d0db096124a5fe59227ed3adcc">getAnneeDat</a>(<span class="keyword">const</span> <a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date)
<a name="l00135"></a>00135 {
<a name="l00136"></a>00136   <span class="keywordflow">if</span>(date)
<a name="l00137"></a>00137     <span class="keywordflow">return</span> date-&gt;<a class="code" href="structs_date.html#add9049e10a4e76da935ad87e79f356c5">annee</a>;
<a name="l00138"></a>00138   <span class="keywordflow">return</span> 0;
<a name="l00139"></a>00139 }
<a name="l00140"></a>00140 
<a name="l00141"></a>00141 
<a name="l00142"></a><a class="code" href="_date_8h.html#a61ddd64fd30de78a30c3dc2f851678c3">00142</a> <span class="keywordtype">void</span> <a class="code" href="_date_8c.html#a61ddd64fd30de78a30c3dc2f851678c3">setAnneeDat</a>(<a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> annee)
<a name="l00143"></a>00143 {
<a name="l00144"></a>00144   <span class="keywordflow">if</span>(date)
<a name="l00145"></a>00145     {
<a name="l00146"></a>00146       date-&gt;<a class="code" href="structs_date.html#add9049e10a4e76da935ad87e79f356c5">annee</a> = annee;
<a name="l00147"></a>00147     }
<a name="l00148"></a>00148 
<a name="l00149"></a>00149 }
<a name="l00150"></a>00150 
<a name="l00151"></a><a class="code" href="_date_8h.html#a06788a5c87216b3ef09560db91f8d3d5">00151</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="_date_8c.html#a06788a5c87216b3ef09560db91f8d3d5">getHeureDat</a>(<span class="keyword">const</span> <a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date)
<a name="l00152"></a>00152 {
<a name="l00153"></a>00153   <span class="keywordflow">if</span>(date)
<a name="l00154"></a>00154     <span class="keywordflow">return</span> date-&gt;<a class="code" href="structs_date.html#a4a1abfda81e08c6312236b17f00a254b">heure</a>;
<a name="l00155"></a>00155   <span class="keywordflow">return</span> 0;
<a name="l00156"></a>00156 }
<a name="l00157"></a>00157 
<a name="l00158"></a><a class="code" href="_date_8h.html#a91a11973f94a56d743b243945f315f1c">00158</a> <span class="keywordtype">void</span> <a class="code" href="_date_8c.html#a91a11973f94a56d743b243945f315f1c">setHeureDat</a>(<a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> heure)
<a name="l00159"></a>00159 {
<a name="l00160"></a>00160   <span class="keywordflow">if</span>(date)
<a name="l00161"></a>00161     {
<a name="l00162"></a>00162       <span class="keywordflow">if</span>(heure &gt; 0 &amp;&amp; heure &lt; 24)
<a name="l00163"></a>00163         date-&gt;<a class="code" href="structs_date.html#a4a1abfda81e08c6312236b17f00a254b">heure</a> = heure;
<a name="l00164"></a>00164     }
<a name="l00165"></a>00165 }
<a name="l00166"></a>00166 
<a name="l00167"></a><a class="code" href="_date_8h.html#afebc60b00425205e95a340ef44a215d6">00167</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="_date_8c.html#afebc60b00425205e95a340ef44a215d6">getMinuteDat</a>(<span class="keyword">const</span> <a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date)
<a name="l00168"></a>00168 {
<a name="l00169"></a>00169   <span class="keywordflow">if</span>(date)
<a name="l00170"></a>00170     <span class="keywordflow">return</span> date-&gt;<a class="code" href="structs_date.html#a8ccf54199aa6a18ea879384260cad09d">minute</a>;
<a name="l00171"></a>00171   <span class="keywordflow">return</span> 0;
<a name="l00172"></a>00172 }
<a name="l00173"></a>00173 
<a name="l00174"></a><a class="code" href="_date_8h.html#a2fa0495ac72457507074e168b03ef2b5">00174</a> <span class="keywordtype">void</span> <a class="code" href="_date_8c.html#a24effb683b6650ef36affd4d67bb521c">setMinuteDat</a>(<a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> minute)
<a name="l00175"></a>00175 {
<a name="l00176"></a>00176   <span class="keywordflow">if</span>(date)
<a name="l00177"></a>00177     {
<a name="l00178"></a>00178       <span class="keywordflow">if</span>(minute&gt;=0 &amp;&amp; minute&lt;61)
<a name="l00179"></a>00179         date-&gt;<a class="code" href="structs_date.html#a8ccf54199aa6a18ea879384260cad09d">minute</a> = minute;
<a name="l00180"></a>00180     }
<a name="l00181"></a>00181 }
<a name="l00182"></a>00182 
<a name="l00183"></a><a class="code" href="_date_8h.html#ae981224c1bacc48824a32ffad705a818">00183</a> <span class="keywordtype">char</span> * <a class="code" href="_date_8c.html#ae981224c1bacc48824a32ffad705a818">getDateDat</a>(<span class="keyword">const</span> <a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date)
<a name="l00184"></a>00184 {
<a name="l00185"></a>00185   <span class="keywordtype">char</span> * chaine;
<a name="l00186"></a>00186   chaine = (<span class="keywordtype">char</span> *) calloc ( 12 , <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
<a name="l00187"></a>00187   sprintf(chaine, <span class="stringliteral">&quot;%d/%d/%d&quot;</span>, <a class="code" href="_date_8c.html#aff629a7f3279f4af67f19cd86f856402">getJourDat</a>(date), <a class="code" href="_date_8c.html#a8e5de805dadea97233846ff131b40886">getMoisDat</a>(date), <a class="code" href="_date_8c.html#aad0245d0db096124a5fe59227ed3adcc">getAnneeDat</a>(date));
<a name="l00188"></a>00188   <span class="keywordflow">return</span> chaine;
<a name="l00189"></a>00189 }
<a name="l00190"></a>00190 
<a name="l00191"></a><a class="code" href="_date_8h.html#ad2532109058c2a7da17457fa12dbabde">00191</a> <span class="keywordtype">char</span> * <a class="code" href="_date_8c.html#ad2532109058c2a7da17457fa12dbabde">getTempsDat</a>(<span class="keyword">const</span> <a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date)
<a name="l00192"></a>00192 {
<a name="l00193"></a>00193   <span class="keywordtype">char</span> * chaine;
<a name="l00194"></a>00194   chaine = (<span class="keywordtype">char</span> *) calloc ( 5, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
<a name="l00195"></a>00195   sprintf(chaine, <span class="stringliteral">&quot;%d:%d&quot;</span>, <a class="code" href="_date_8c.html#a06788a5c87216b3ef09560db91f8d3d5">getHeureDat</a>(date), <a class="code" href="_date_8c.html#afebc60b00425205e95a340ef44a215d6">getMinuteDat</a>(date));
<a name="l00196"></a>00196   <span class="keywordflow">return</span> chaine;
<a name="l00197"></a>00197 }
<a name="l00198"></a>00198 
<a name="l00199"></a><a class="code" href="_date_8h.html#a085f12fd575e2b10cef17a4ef6af3afc">00199</a> <span class="keywordtype">char</span> * <a class="code" href="_date_8c.html#a085f12fd575e2b10cef17a4ef6af3afc">getDate</a>(<span class="keyword">const</span> <a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date)
<a name="l00200"></a>00200 {
<a name="l00201"></a>00201   <span class="keywordtype">char</span> * chaine;
<a name="l00202"></a>00202   chaine = (<span class="keywordtype">char</span> *) calloc ( 18 , <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
<a name="l00203"></a>00203   sprintf(chaine, <span class="stringliteral">&quot;%d/%d/%d %d:%d&quot;</span>,<a class="code" href="_date_8c.html#aff629a7f3279f4af67f19cd86f856402">getJourDat</a>(date), <a class="code" href="_date_8c.html#a8e5de805dadea97233846ff131b40886">getMoisDat</a>(date), <a class="code" href="_date_8c.html#aad0245d0db096124a5fe59227ed3adcc">getAnneeDat</a>(date)
<a name="l00204"></a>00204           , <a class="code" href="_date_8c.html#a06788a5c87216b3ef09560db91f8d3d5">getHeureDat</a>(date), <a class="code" href="_date_8c.html#afebc60b00425205e95a340ef44a215d6">getMinuteDat</a>(date));
<a name="l00205"></a>00205   <span class="keywordflow">return</span> chaine;
<a name="l00206"></a>00206 }
<a name="l00207"></a>00207 
<a name="l00208"></a><a class="code" href="_date_8h.html#a9f1eaa90b3449259c421c89a55a78de5">00208</a> <span class="keywordtype">void</span> <a class="code" href="_date_8c.html#a9f1eaa90b3449259c421c89a55a78de5" title="Afficher l&#39;date.">affDat</a>(<span class="keyword">const</span> <a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> *date)
<a name="l00209"></a>00209 {
<a name="l00210"></a>00210     <span class="keywordtype">char</span> *d;
<a name="l00211"></a>00211     d = <a class="code" href="_date_8c.html#a085f12fd575e2b10cef17a4ef6af3afc">getDate</a>(date);
<a name="l00212"></a>00212     printf(<span class="stringliteral">&quot;\nDate : %s&quot;</span>, d);
<a name="l00213"></a>00213     <span class="comment">/*free(d);*/</span>
<a name="l00214"></a>00214 }
<a name="l00215"></a>00215 
<a name="l00216"></a><a class="code" href="_date_8h.html#a22d0050111d98bb73a528b65a40e9197">00216</a> <span class="keywordtype">void</span> <a class="code" href="_date_8c.html#a22d0050111d98bb73a528b65a40e9197">regDat</a>()
<a name="l00217"></a>00217 {
<a name="l00218"></a>00218     <span class="keywordtype">char</span> *d, *t;
<a name="l00219"></a>00219     <a class="code" href="structs_date.html" title="Structure utilisée pour la gestion des dates.">Date</a> * date;
<a name="l00220"></a>00220     date = <a class="code" href="_date_8c.html#a91969b639b15aab01753c1fdf3158c0a">creDat</a>(21,11,2011,13,30);
<a name="l00221"></a>00221     d = <a class="code" href="_date_8c.html#a085f12fd575e2b10cef17a4ef6af3afc">getDate</a>(date);
<a name="l00222"></a>00222     t = <a class="code" href="_date_8c.html#ad2532109058c2a7da17457fa12dbabde">getTempsDat</a>(date);
<a name="l00223"></a>00223     printf(<span class="stringliteral">&quot;\nDate : %s&quot;</span>,d);
<a name="l00224"></a>00224     printf(<span class="stringliteral">&quot;\nTemps : %s\n&quot;</span>,t);
<a name="l00225"></a>00225     <a class="code" href="_date_8c.html#af9b759e4f66d43f5e95b54ab3c060a78">detDat</a>(&amp;date);
<a name="l00226"></a>00226     free(d);
<a name="l00227"></a>00227     free(t);
<a name="l00228"></a>00228 }
<a name="l00229"></a>00229 
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_date_8c.html">Date.c</a>      </li>
      <li class="footer">Généré le Thu Jun 7 2012 17:01:10 pour Gestion_Des_Inscriptions_Universitaires par&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </li>
    </ul>
  </div>

</body>
</html>
